<!DOCTYPE HTML>
<html lang="zh-hans" >
    
    <head>
        
        <meta charset="UTF-8">
        <meta http-equiv="X-UA-Compatible" content="IE=edge" />
        <title>5.高度动态的数据集分析 | Apache Drill</title>
        <meta content="text/html; charset=utf-8" http-equiv="Content-Type">
        <meta name="description" content="">
        <meta name="generator" content="GitBook 2.6.6">
        <meta name="author" content="smartloli">
        
        <meta name="HandheldFriendly" content="true"/>
        <meta name="viewport" content="width=device-width, initial-scale=1, user-scalable=no">
        <meta name="apple-mobile-web-app-capable" content="yes">
        <meta name="apple-mobile-web-app-status-bar-style" content="black">
        <link rel="apple-touch-icon-precomposed" sizes="152x152" href="../gitbook/images/apple-touch-icon-precomposed-152.png">
        <link rel="shortcut icon" href="../gitbook/images/favicon.ico" type="image/x-icon">
        
    <link rel="stylesheet" href="../gitbook/style.css">
    
        
        <link rel="stylesheet" href="../gitbook/plugins/gitbook-plugin-tbfed-pagefooter/footer.css">
        
    
        
        <link rel="stylesheet" href="../gitbook/plugins/gitbook-plugin-highlight/website.css">
        
    
        
        <link rel="stylesheet" href="../gitbook/plugins/gitbook-plugin-fontsettings/website.css">
        
    
    

        
    
    
    <link rel="next" href="../3.教程/6.社会媒体分析.html" />
    
    
    <link rel="prev" href="../3.教程/4.在 MapR 的 Sandbox 中学习 Drill/7.总结.html" />
    

        
    </head>
    <body>
        
        
    <div class="book"
        data-level="3.5"
        data-chapter-title="5.高度动态的数据集分析"
        data-filepath="3.教程/5.高度动态的数据集分析.md"
        data-basepath=".."
        data-revision="Fri Aug 26 2016 12:40:11 GMT+0800 (CST)"
        data-innerlanguage="">
    

<div class="book-summary">
    <nav role="navigation">
        <ul class="summary">
            
            
            
                
                <li>
                    <a href="http://drill.smartloli.org" target="blank" class="custom-link">Apache Drill</a>
                </li>
            
            

            
            <li class="divider"></li>
            

            
    
        <li class="chapter " data-level="0" data-path="index.html">
            
                
                    <a href="../index.html">
                
                        <i class="fa fa-check"></i>
                        
                        前言
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="1" >
            
            <span><b>1.</b> 1.开始</span>
            
            
            <ul class="articles">
                
    
        <li class="chapter " data-level="1.1" data-path="1.开始/1.Introduction 介绍.html">
            
                
                    <a href="../1.开始/1.Introduction 介绍.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>1.1.</b>
                        
                        1.Introduction 介绍
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="1.2" data-path="1.开始/2.Why Drill 为什么使用 Drill.html">
            
                
                    <a href="../1.开始/2.Why Drill 为什么使用 Drill.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>1.2.</b>
                        
                        2.Why Drill 为什么使用 Drill
                    </a>
            
            
        </li>
    

            </ul>
            
        </li>
    
        <li class="chapter " data-level="2" >
            
            <span><b>2.</b> 2.架构</span>
            
            
            <ul class="articles">
                
    
        <li class="chapter " data-level="2.1" data-path="2.架构/1.Architecture Introduction 架构介绍.html">
            
                
                    <a href="../2.架构/1.Architecture Introduction 架构介绍.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>2.1.</b>
                        
                        1.Architecture Introduction 架构介绍
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="2.2" data-path="2.架构/2.Drill Query Execution Drill 查询执行.html">
            
                
                    <a href="../2.架构/2.Drill Query Execution Drill 查询执行.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>2.2.</b>
                        
                        2.Drill Query Execution Drill 查询执行
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="2.3" data-path="2.架构/3.Core Modules 核心模块.html">
            
                
                    <a href="../2.架构/3.Core Modules 核心模块.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>2.3.</b>
                        
                        3.Core Modules 核心模块
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="2.4" data-path="2.架构/4.Performance 性能.html">
            
                
                    <a href="../2.架构/4.Performance 性能.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>2.4.</b>
                        
                        4.Performance 性能
                    </a>
            
            
        </li>
    

            </ul>
            
        </li>
    
        <li class="chapter " data-level="3" >
            
            <span><b>3.</b> 3.教程</span>
            
            
            <ul class="articles">
                
    
        <li class="chapter " data-level="3.1" data-path="3.教程/1.Tutorials Introduction 教程介绍.html">
            
                
                    <a href="../3.教程/1.Tutorials Introduction 教程介绍.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>3.1.</b>
                        
                        1.Tutorials Introduction 教程介绍
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="3.2" data-path="3.教程/2.Drill in 10 Minutes 快速指导.html">
            
                
                    <a href="../3.教程/2.Drill in 10 Minutes 快速指导.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>3.2.</b>
                        
                        2.Drill in 10 Minutes 快速指导
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="3.3" data-path="3.教程/3.A-Y-A-D 数据集分析.html">
            
                
                    <a href="../3.教程/3.A-Y-A-D 数据集分析.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>3.3.</b>
                        
                        3.A-Y-A-D 数据集分析
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="3.4" >
            
            <span><b>3.4.</b> 4.在 MapR 的 Sandbox 中学习 Drill</span>
            
            
            <ul class="articles">
                
    
        <li class="chapter " data-level="3.4.1" data-path="3.教程/4.在 MapR 的 Sandbox 中学习 Drill/1.关于 MapR 的 Sandbox.html">
            
                
                    <a href="../3.教程/4.在 MapR 的 Sandbox 中学习 Drill/1.关于 MapR 的 Sandbox.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>3.4.1.</b>
                        
                        1.关于 MapR 的 Sandbox
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="3.4.2" data-path="3.教程/4.在 MapR 的 Sandbox 中学习 Drill/2.在 Sandbox 中安装 Drill.html">
            
                
                    <a href="../3.教程/4.在 MapR 的 Sandbox 中学习 Drill/2.在 Sandbox 中安装 Drill.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>3.4.2.</b>
                        
                        2.在 Sandbox 中安装 Drill
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="3.4.3" data-path="3.教程/4.在 MapR 的 Sandbox 中学习 Drill/3.在 Sandbox 中使用 Drill.html">
            
                
                    <a href="../3.教程/4.在 MapR 的 Sandbox 中学习 Drill/3.在 Sandbox 中使用 Drill.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>3.4.3.</b>
                        
                        3.在 Sandbox 中使用 Drill
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="3.4.4" data-path="3.教程/4.在 MapR 的 Sandbox 中学习 Drill/4.课程1:学习数据集.html">
            
                
                    <a href="../3.教程/4.在 MapR 的 Sandbox 中学习 Drill/4.课程1:学习数据集.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>3.4.4.</b>
                        
                        4.课程1:学习数据集
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="3.4.5" data-path="3.教程/4.在 MapR 的 Sandbox 中学习 Drill/5.课程2:使用 ANSI SQL 查询.html">
            
                
                    <a href="../3.教程/4.在 MapR 的 Sandbox 中学习 Drill/5.课程2:使用 ANSI SQL 查询.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>3.4.5.</b>
                        
                        5.课程2:使用 ANSI SQL 查询
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="3.4.6" data-path="3.教程/4.在 MapR 的 Sandbox 中学习 Drill/6.课程3:查询复杂的数据类型.html">
            
                
                    <a href="../3.教程/4.在 MapR 的 Sandbox 中学习 Drill/6.课程3:查询复杂的数据类型.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>3.4.6.</b>
                        
                        6.课程3:查询复杂的数据类型
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="3.4.7" data-path="3.教程/4.在 MapR 的 Sandbox 中学习 Drill/7.总结.html">
            
                
                    <a href="../3.教程/4.在 MapR 的 Sandbox 中学习 Drill/7.总结.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>3.4.7.</b>
                        
                        7.总结
                    </a>
            
            
        </li>
    

            </ul>
            
        </li>
    
        <li class="chapter active" data-level="3.5" data-path="3.教程/5.高度动态的数据集分析.html">
            
                
                    <a href="../3.教程/5.高度动态的数据集分析.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>3.5.</b>
                        
                        5.高度动态的数据集分析
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="3.6" data-path="3.教程/6.社会媒体分析.html">
            
                
                    <a href="../3.教程/6.社会媒体分析.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>3.6.</b>
                        
                        6.社会媒体分析
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="3.7" data-path="3.教程/7.使用窗口函数分析数据.html">
            
                
                    <a href="../3.教程/7.使用窗口函数分析数据.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>3.7.</b>
                        
                        7.使用窗口函数分析数据
                    </a>
            
            
        </li>
    

            </ul>
            
        </li>
    
        <li class="chapter " data-level="4" >
            
            <span><b>4.</b> 4.安装 Drill</span>
            
            
            <ul class="articles">
                
    
        <li class="chapter " data-level="4.1" data-path="4.安装 Drill/1.Drill 安装介绍.html">
            
                
                    <a href="../4.安装 Drill/1.Drill 安装介绍.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>4.1.</b>
                        
                        1.Drill 安装介绍
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="4.2" data-path="4.安装 Drill/2.迁移 Parquet 数据.html">
            
                
                    <a href="../4.安装 Drill/2.迁移 Parquet 数据.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>4.2.</b>
                        
                        2.迁移 Parquet 数据
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="4.3" >
            
            <span><b>4.3.</b> 3.安装 Drill 到嵌入模式</span>
            
            
            <ul class="articles">
                
    
        <li class="chapter " data-level="4.3.1" data-path="4.安装 Drill/3.安装 Drill 到嵌入模式/1.嵌入模式的先决条件.html">
            
                
                    <a href="../4.安装 Drill/3.安装 Drill 到嵌入模式/1.嵌入模式的先决条件.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>4.3.1.</b>
                        
                        1.嵌入模式的先决条件
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="4.3.2" data-path="4.安装 Drill/3.安装 Drill 到嵌入模式/2.在 Linux 和 Mac OS X 上安装 Drill.html">
            
                
                    <a href="../4.安装 Drill/3.安装 Drill 到嵌入模式/2.在 Linux 和 Mac OS X 上安装 Drill.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>4.3.2.</b>
                        
                        2.在 Linux 和 Mac OS X 上安装 Drill
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="4.3.3" data-path="4.安装 Drill/3.安装 Drill 到嵌入模式/3.在 Linux 和 Mac OS X 上启动 Drill.html">
            
                
                    <a href="../4.安装 Drill/3.安装 Drill 到嵌入模式/3.在 Linux 和 Mac OS X 上启动 Drill.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>4.3.3.</b>
                        
                        3.在 Linux 和 Mac OS X 上启动 Drill
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="4.3.4" data-path="4.安装 Drill/3.安装 Drill 到嵌入模式/4.在 Windows 上安装 Drill.html">
            
                
                    <a href="../4.安装 Drill/3.安装 Drill 到嵌入模式/4.在 Windows 上安装 Drill.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>4.3.4.</b>
                        
                        4.在 Windows 上安装 Drill
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="4.3.5" data-path="4.安装 Drill/3.安装 Drill 到嵌入模式/5.在 Windows 上启动 Drill.html">
            
                
                    <a href="../4.安装 Drill/3.安装 Drill 到嵌入模式/5.在 Windows 上启动 Drill.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>4.3.5.</b>
                        
                        5.在 Windows 上启动 Drill
                    </a>
            
            
        </li>
    

            </ul>
            
        </li>
    
        <li class="chapter " data-level="4.4" >
            
            <span><b>4.4.</b> 4.安装 Drill 到分布式模式</span>
            
            
            <ul class="articles">
                
    
        <li class="chapter " data-level="4.4.1" data-path="4.安装 Drill/4.安装 Drill 到分布式模式/1.分布式模式的先决条件.html">
            
                
                    <a href="../4.安装 Drill/4.安装 Drill 到分布式模式/1.分布式模式的先决条件.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>4.4.1.</b>
                        
                        1.分布式模式的先决条件
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="4.4.2" data-path="4.安装 Drill/4.安装 Drill 到分布式模式/2.在集群上安装 Drill.html">
            
                
                    <a href="../4.安装 Drill/4.安装 Drill 到分布式模式/2.在集群上安装 Drill.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>4.4.2.</b>
                        
                        2.在集群上安装 Drill
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="4.4.3" data-path="4.安装 Drill/4.安装 Drill 到分布式模式/3.在分布式模式下启动 Drill.html">
            
                
                    <a href="../4.安装 Drill/4.安装 Drill 到分布式模式/3.在分布式模式下启动 Drill.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>4.4.3.</b>
                        
                        3.在分布式模式下启动 Drill
                    </a>
            
            
        </li>
    

            </ul>
            
        </li>
    
        <li class="chapter " data-level="4.5" data-path="4.安装 Drill/5.启动 Web 控制台.html">
            
                
                    <a href="../4.安装 Drill/5.启动 Web 控制台.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>4.5.</b>
                        
                        5.启动 Web 控制台
                    </a>
            
            
        </li>
    

            </ul>
            
        </li>
    
        <li class="chapter " data-level="5" >
            
            <span><b>5.</b> 5.配置 Drill</span>
            
            
            <ul class="articles">
                
    
        <li class="chapter " data-level="5.1" data-path="5.配置 Drill/1.配置介绍.html">
            
                
                    <a href="../5.配置 Drill/1.配置介绍.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>5.1.</b>
                        
                        1.配置介绍
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="5.2" data-path="5.配置 Drill/2.配置内存.html">
            
                
                    <a href="../5.配置 Drill/2.配置内存.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>5.2.</b>
                        
                        2.配置内存
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="5.3" >
            
            <span><b>5.3.</b> 3.配置一个多租户集群</span>
            
            
            <ul class="articles">
                
    
        <li class="chapter " data-level="5.3.1" data-path="5.配置 Drill/3.配置一个多租户集群/1.配置一个多租户介绍.html">
            
                
                    <a href="../5.配置 Drill/3.配置一个多租户集群/1.配置一个多租户介绍.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>5.3.1.</b>
                        
                        1.配置一个多租户介绍
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="5.3.2" data-path="5.配置 Drill/3.配置一个多租户集群/2.配置多租户资源.html">
            
                
                    <a href="../5.配置 Drill/3.配置一个多租户集群/2.配置多租户资源.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>5.3.2.</b>
                        
                        2.配置多租户资源
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="5.3.3" data-path="5.配置 Drill/3.配置一个多租户集群/3.配置 Drillbit 共享资源.html">
            
                
                    <a href="../5.配置 Drill/3.配置一个多租户集群/3.配置 Drillbit 共享资源.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>5.3.3.</b>
                        
                        3.配置 Drillbit 共享资源
                    </a>
            
            
        </li>
    

            </ul>
            
        </li>
    
        <li class="chapter " data-level="5.4" data-path="5.配置 Drill/4.配置模拟身份.html">
            
                
                    <a href="../5.配置 Drill/4.配置模拟身份.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>5.4.</b>
                        
                        4.配置模拟身份
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="5.5" data-path="5.配置 Drill/5.配置用户身份验证.html">
            
                
                    <a href="../5.配置 Drill/5.配置用户身份验证.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>5.5.</b>
                        
                        5.配置用户身份验证
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="5.6" data-path="5.配置 Drill/6.配置 Hive 用户身份验证.html">
            
                
                    <a href="../5.配置 Drill/6.配置 Hive 用户身份验证.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>5.6.</b>
                        
                        6.配置 Hive 用户身份验证
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="5.7" data-path="5.配置 Drill/7.配置 Web 控制台和 REST API 安全.html">
            
                
                    <a href="../5.配置 Drill/7.配置 Web 控制台和 REST API 安全.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>5.7.</b>
                        
                        7.配置 Web 控制台和 REST API 安全
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="5.8" >
            
            <span><b>5.8.</b> 8.可选配置</span>
            
            
            <ul class="articles">
                
    
        <li class="chapter " data-level="5.8.1" data-path="5.配置 Drill/8.可选配置/1.可选配置介绍.html">
            
                
                    <a href="../5.配置 Drill/8.可选配置/1.可选配置介绍.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>5.8.1.</b>
                        
                        1.可选配置介绍
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="5.8.2" data-path="5.配置 Drill/8.可选配置/2.启动可选项.html">
            
                
                    <a href="../5.配置 Drill/8.可选配置/2.启动可选项.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>5.8.2.</b>
                        
                        2.启动可选项
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="5.8.3" data-path="5.配置 Drill/8.可选配置/3.计划和执行可选项.html">
            
                
                    <a href="../5.配置 Drill/8.可选配置/3.计划和执行可选项.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>5.8.3.</b>
                        
                        3.计划和执行可选项
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="5.8.4" data-path="5.配置 Drill/8.可选配置/4.持久化配置存储.html">
            
                
                    <a href="../5.配置 Drill/8.可选配置/4.持久化配置存储.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>5.8.4.</b>
                        
                        4.持久化配置存储
                    </a>
            
            
        </li>
    

            </ul>
            
        </li>
    
        <li class="chapter " data-level="5.9" data-path="5.配置 Drill/9.Drill 端口使用.html">
            
                
                    <a href="../5.配置 Drill/9.Drill 端口使用.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>5.9.</b>
                        
                        9.Drill 端口使用
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="5.10" data-path="5.配置 Drill/10.配置 Drill 终端.html">
            
                
                    <a href="../5.配置 Drill/10.配置 Drill 终端.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>5.10.</b>
                        
                        10.配置 Drill 终端
                    </a>
            
            
        </li>
    

            </ul>
            
        </li>
    
        <li class="chapter " data-level="6" >
            
            <span><b>6.</b> 6.连接数据源</span>
            
            
            <ul class="articles">
                
    
        <li class="chapter " data-level="6.1" data-path="6.连接数据源/1.介绍.html">
            
                
                    <a href="../6.连接数据源/1.介绍.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>6.1.</b>
                        
                        1.介绍
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="6.2" data-path="6.连接数据源/2.注册存储插件.html">
            
                
                    <a href="../6.连接数据源/2.注册存储插件.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>6.2.</b>
                        
                        2.注册存储插件
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="6.3" >
            
            <span><b>6.3.</b> 3.配置存储插件</span>
            
            
            <ul class="articles">
                
    
        <li class="chapter " data-level="6.3.1" data-path="6.连接数据源/3.配置存储插件/1.插件基础设置.html">
            
                
                    <a href="../6.连接数据源/3.配置存储插件/1.插件基础设置.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>6.3.1.</b>
                        
                        1.插件基础设置
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="6.3.2" data-path="6.连接数据源/3.配置存储插件/2.工作区间.html">
            
                
                    <a href="../6.连接数据源/3.配置存储插件/2.工作区间.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>6.3.2.</b>
                        
                        2.工作区间
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="6.3.3" data-path="6.连接数据源/3.配置存储插件/3.Drill 默认输出格式.html">
            
                
                    <a href="../6.连接数据源/3.配置存储插件/3.Drill 默认输出格式.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>6.3.3.</b>
                        
                        3.Drill 默认输出格式
                    </a>
            
            
        </li>
    

            </ul>
            
        </li>
    
        <li class="chapter " data-level="6.4" data-path="6.连接数据源/4.文件系统存储插件.html">
            
                
                    <a href="../6.连接数据源/4.文件系统存储插件.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>6.4.</b>
                        
                        4.文件系统存储插件
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="6.5" data-path="6.连接数据源/5.HBase 存储插件.html">
            
                
                    <a href="../6.连接数据源/5.HBase 存储插件.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>6.5.</b>
                        
                        5.HBase 存储插件
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="6.6" data-path="6.连接数据源/6.Hive 存储插件.html">
            
                
                    <a href="../6.连接数据源/6.Hive 存储插件.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>6.6.</b>
                        
                        6.Hive 存储插件
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="6.7" data-path="6.连接数据源/7.RDBMS 存储插件.html">
            
                
                    <a href="../6.连接数据源/7.RDBMS 存储插件.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>6.7.</b>
                        
                        7.RDBMS 存储插件
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="6.8" data-path="6.连接数据源/8.MongoDB 存储插件.html">
            
                
                    <a href="../6.连接数据源/8.MongoDB 存储插件.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>6.8.</b>
                        
                        8.MongoDB 存储插件
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="6.9" data-path="6.连接数据源/9.S3 存储插件.html">
            
                
                    <a href="../6.连接数据源/9.S3 存储插件.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>6.9.</b>
                        
                        9.S3 存储插件
                    </a>
            
            
        </li>
    

            </ul>
            
        </li>
    
        <li class="chapter " data-level="7" >
            
            <span><b>7.</b> 7.ODBC 和 JDBC 接口</span>
            
            
            <ul class="articles">
                
    
        <li class="chapter " data-level="7.1" data-path="7.ODBC 和 JDBC 接口/1.介绍.html">
            
                
                    <a href="../7.ODBC 和 JDBC 接口/1.介绍.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>7.1.</b>
                        
                        1.介绍
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="7.2" data-path="7.ODBC 和 JDBC 接口/2.使用 JDBC 驱动.html">
            
                
                    <a href="../7.ODBC 和 JDBC 接口/2.使用 JDBC 驱动.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>7.2.</b>
                        
                        2.使用 JDBC 驱动
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="7.3" data-path="7.ODBC 和 JDBC 接口/3.在 Windows 上使用 JDBC 和 SQuirreL.html">
            
                
                    <a href="../7.ODBC 和 JDBC 接口/3.在 Windows 上使用 JDBC 和 SQuirreL.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>7.3.</b>
                        
                        3.在 Windows 上使用 JDBC 和 SQuirreL
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="7.4" >
            
            <span><b>7.4.</b> 4.安装 ODBC 驱动</span>
            
            
            <ul class="articles">
                
    
        <li class="chapter " data-level="7.4.1" data-path="7.ODBC 和 JDBC 接口/4.安装 ODBC 驱动/1.在 Linux 上安装驱动.html">
            
                
                    <a href="../7.ODBC 和 JDBC 接口/4.安装 ODBC 驱动/1.在 Linux 上安装驱动.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>7.4.1.</b>
                        
                        1.在 Linux 上安装驱动
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="7.4.2" data-path="7.ODBC 和 JDBC 接口/4.安装 ODBC 驱动/2.在 Mac OS X 上安装驱动.html">
            
                
                    <a href="../7.ODBC 和 JDBC 接口/4.安装 ODBC 驱动/2.在 Mac OS X 上安装驱动.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>7.4.2.</b>
                        
                        2.在 Mac OS X 上安装驱动
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="7.4.3" data-path="7.ODBC 和 JDBC 接口/4.安装 ODBC 驱动/3.在 Windows 上安装驱动.html">
            
                
                    <a href="../7.ODBC 和 JDBC 接口/4.安装 ODBC 驱动/3.在 Windows 上安装驱动.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>7.4.3.</b>
                        
                        3.在 Windows 上安装驱动
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="7.4.4" data-path="7.ODBC 和 JDBC 接口/4.安装 ODBC 驱动/4.在 Windows 上安装 TDC 文件.html">
            
                
                    <a href="../7.ODBC 和 JDBC 接口/4.安装 ODBC 驱动/4.在 Windows 上安装 TDC 文件.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>7.4.4.</b>
                        
                        4.在 Windows 上安装 TDC 文件
                    </a>
            
            
        </li>
    

            </ul>
            
        </li>
    
        <li class="chapter " data-level="7.5" >
            
            <span><b>7.5.</b> 5.配置 ODBC</span>
            
            
            <ul class="articles">
                
    
        <li class="chapter " data-level="7.5.1" data-path="7.ODBC 和 JDBC 接口/5.配置 ODBC/1.ODBC 配置参考.html">
            
                
                    <a href="../7.ODBC 和 JDBC 接口/5.配置 ODBC/1.ODBC 配置参考.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>7.5.1.</b>
                        
                        1.ODBC 配置参考
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="7.5.2" data-path="7.ODBC 和 JDBC 接口/5.配置 ODBC/2.在 Linux 上配置 ODBC.html">
            
                
                    <a href="../7.ODBC 和 JDBC 接口/5.配置 ODBC/2.在 Linux 上配置 ODBC.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>7.5.2.</b>
                        
                        2.在 Linux 上配置 ODBC
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="7.5.3" data-path="7.ODBC 和 JDBC 接口/5.配置 ODBC/3.在 Max OS X 上配置 ODBC.html">
            
                
                    <a href="../7.ODBC 和 JDBC 接口/5.配置 ODBC/3.在 Max OS X 上配置 ODBC.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>7.5.3.</b>
                        
                        3.在 Max OS X 上配置 ODBC
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="7.5.4" data-path="7.ODBC 和 JDBC 接口/5.配置 ODBC/4.在 Windows 上配置 ODBC.html">
            
                
                    <a href="../7.ODBC 和 JDBC 接口/5.配置 ODBC/4.在 Windows 上配置 ODBC.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>7.5.4.</b>
                        
                        4.在 Windows 上配置 ODBC
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="7.5.5" data-path="7.ODBC 和 JDBC 接口/5.配置 ODBC/5.测试 ODBC 连接.html">
            
                
                    <a href="../7.ODBC 和 JDBC 接口/5.配置 ODBC/5.测试 ODBC 连接.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>7.5.5.</b>
                        
                        5.测试 ODBC 连接
                    </a>
            
            
        </li>
    

            </ul>
            
        </li>
    
        <li class="chapter " data-level="7.6" >
            
            <span><b>7.6.</b> 6.使用 Drill</span>
            
            
            <ul class="articles">
                
    
        <li class="chapter " data-level="7.6.1" data-path="7.ODBC 和 JDBC 接口/6.使用 Drill/1.介绍.html">
            
                
                    <a href="../7.ODBC 和 JDBC 接口/6.使用 Drill/1.介绍.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>7.6.1.</b>
                        
                        1.介绍
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="7.6.2" data-path="7.ODBC 和 JDBC 接口/6.使用 Drill/2.连接 Drill 到数据源.html">
            
                
                    <a href="../7.ODBC 和 JDBC 接口/6.使用 Drill/2.连接 Drill 到数据源.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>7.6.2.</b>
                        
                        2.连接 Drill 到数据源
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="7.6.3" data-path="7.ODBC 和 JDBC 接口/6.使用 Drill/3.浏览数据和定义视图.html">
            
                
                    <a href="../7.ODBC 和 JDBC 接口/6.使用 Drill/3.浏览数据和定义视图.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>7.6.3.</b>
                        
                        3.浏览数据和定义视图
                    </a>
            
            
        </li>
    

            </ul>
            
        </li>
    
        <li class="chapter " data-level="7.7" >
            
            <span><b>7.7.</b> 7.用 BI 工具连接 Drill</span>
            
            
            <ul class="articles">
                
    
        <li class="chapter " data-level="7.7.1" data-path="7.ODBC 和 JDBC 接口/7.用 BI 工具连接 Drill/1.介绍.html">
            
                
                    <a href="../7.ODBC 和 JDBC 接口/7.用 BI 工具连接 Drill/1.介绍.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>7.7.1.</b>
                        
                        1.介绍
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="7.7.2" data-path="7.ODBC 和 JDBC 接口/7.用 BI 工具连接 Drill/2.Tableau 示例.html">
            
                
                    <a href="../7.ODBC 和 JDBC 接口/7.用 BI 工具连接 Drill/2.Tableau 示例.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>7.7.2.</b>
                        
                        2.使用 JDBC 驱动
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="7.7.3" data-path="7.ODBC 和 JDBC 接口/7.用 BI 工具连接 Drill/3.使用 MicroStrategy 分析.html">
            
                
                    <a href="../7.ODBC 和 JDBC 接口/7.用 BI 工具连接 Drill/3.使用 MicroStrategy 分析.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>7.7.3.</b>
                        
                        3.在 Windows 上使用 JDBC 和 SQuirreL
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="7.7.4" data-path="7.ODBC 和 JDBC 接口/7.用 BI 工具连接 Drill/4.使用 Tibco Spotfire 客户端.html">
            
                
                    <a href="../7.ODBC 和 JDBC 接口/7.用 BI 工具连接 Drill/4.使用 Tibco Spotfire 客户端.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>7.7.4.</b>
                        
                        4.使用 Tibco Spotfire 客户端
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="7.7.5" data-path="7.ODBC 和 JDBC 接口/7.用 BI 工具连接 Drill/5.使用 Qlik Sense.html">
            
                
                    <a href="../7.ODBC 和 JDBC 接口/7.用 BI 工具连接 Drill/5.使用 Qlik Sense.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>7.7.5.</b>
                        
                        5.使用 Qlik Sense
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="7.7.6" data-path="7.ODBC 和 JDBC 接口/7.用 BI 工具连接 Drill/6.使用 Tableau 9 客户端.html">
            
                
                    <a href="../7.ODBC 和 JDBC 接口/7.用 BI 工具连接 Drill/6.使用 Tableau 9 客户端.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>7.7.6.</b>
                        
                        6.使用 Tableau 9 客户端
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="7.7.7" data-path="7.ODBC 和 JDBC 接口/7.用 BI 工具连接 Drill/7.使用 Tableau 9 服务端.html">
            
                
                    <a href="../7.ODBC 和 JDBC 接口/7.用 BI 工具连接 Drill/7.使用 Tableau 9 服务端.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>7.7.7.</b>
                        
                        7.使用 Tableau 9 服务端
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="7.7.8" data-path="7.ODBC 和 JDBC 接口/7.用 BI 工具连接 Drill/8.配置 JReport.html">
            
                
                    <a href="../7.ODBC 和 JDBC 接口/7.用 BI 工具连接 Drill/8.配置 JReport.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>7.7.8.</b>
                        
                        8.配置 JReport
                    </a>
            
            
        </li>
    

            </ul>
            
        </li>
    

            </ul>
            
        </li>
    


            
            <li class="divider"></li>
            <li>
                <a href="https://www.gitbook.com" target="blank" class="gitbook-link">
                    本书使用 GitBook 发布
                </a>
            </li>
            
        </ul>
    </nav>
</div>

    <div class="book-body">
        <div class="body-inner">
            <div class="book-header" role="navigation">
    <!-- Actions Left -->
    

    <!-- Title -->
    <h1>
        <i class="fa fa-circle-o-notch fa-spin"></i>
        <a href="../" >Apache Drill</a>
    </h1>
</div>

            <div class="page-wrapper" tabindex="-1" role="main">
                <div class="page-inner">
                
                
                    <section class="normal" id="section-">
                    
                        <h1 id="&#x9AD8;&#x52A8;&#x6001;&#x6570;&#x636E;&#x96C6;&#x5206;&#x6790;">&#x9AD8;&#x52A8;&#x6001;&#x6570;&#x636E;&#x96C6;&#x5206;&#x6790;</h1>
<p>&#x4ECA;&#x5929;&#x7684;&#x6570;&#x636E;&#x662F;&#x52A8;&#x6001;&#x7684;&#x548C;&#x7531;&#x5E94;&#x7528;&#x7A0B;&#x5E8F;&#x9A71;&#x52A8;&#x7684;&#x3002;&#x4E00;&#x4E2A;&#x65B0;&#x7684;&#x6570;&#x636E;&#x7C7B;&#x578B;&#x548C;&#x65B0;&#x7684;&#x6570;&#x636E;&#x6A21;&#x578B;&#xFF0C;&#x751F;&#x6210;&#x6570;&#x636E;&#x96C6;&#xFF0C;&#x662F;&#x5546;&#x4E1A;&#x5E94;&#x7528;&#x7684;&#x53D1;&#x5C55;&#x8D8B;&#x52BF;&#xFF0C;&#x6BD4;&#x5982;&#x7F51;&#x7EDC;&#xFF0C;&#x793E;&#x4EA4;&#xFF0C;&#x79FB;&#x52A8;&#x548C;&#x4E92;&#x8054;&#x7F51;&#x7684;&#x65B0;&#x65F6;&#x4EE3;&#x7684;&#x589E;&#x957F;&#x3002;&#x8FD9;&#x4E9B;&#x5E94;&#x7528;&#x7A0B;&#x5E8F;&#x88AB;&#x5FEB;&#x901F;&#x8FED;&#x4EE3;&#xFF0C;&#x8FD9;&#x4E9B;&#x6570;&#x636E;&#x6A21;&#x578B;&#x548C;&#x534A;&#x7ED3;&#x6784;&#x5316;&#xFF0C;&#x65E0; Schema &#x7ED3;&#x5408;&#xFF0C;&#x5E76;&#x5FEB;&#x901F;&#x53D1;&#x5C55;&#x3002;&#x534A;&#x7ED3;&#x6784;&#x5316;&#x6570;&#x636E;&#x6A21;&#x578B;&#x53EF;&#x4EE5;&#x662F;&#x590D;&#x6742;&#x7684;/&#x5D4C;&#x5957;&#x7684;&#xFF0C;&#x65E0; Schema &#x7684;&#xFF0C;&#x5E76;&#x4E14;&#x80FD;&#x591F;&#x5728;&#x6BCF;&#x4E00;&#x884C;&#x4E2D;&#x5177;&#x6709;&#x4E0D;&#x540C;&#x7684;&#x5B57;&#x6BB5;&#xFF0C;&#x5E76;&#x4E0D;&#x65AD;&#x5730;&#x53D1;&#x5C55;&#xFF0C;&#x4EE5;&#x6EE1;&#x8DB3;&#x4E1A;&#x52A1;&#x9700;&#x6C42;&#x7684;&#x4E0D;&#x65AD;&#x589E;&#x52A0;&#x548C;&#x5220;&#x9664;&#x3002;</p>
<p>&#x672C;&#x6559;&#x7A0B;&#x5411;&#x4F60;&#x5C55;&#x793A;&#x5982;&#x4F55;&#x6765;&#x67E5;&#x8BE2;&#x52A8;&#x6001;&#x6570;&#x636E;&#xFF0C;&#x4F8B;&#x5982; JSON&#xFF0C;&#x5E76;&#x5728;&#x51E0;&#x5206;&#x949F;&#x4E4B;&#x5185;&#x4ECE;&#x4EFB;&#x4F55;&#x6570;&#x636E;&#x7C7B;&#x578B;&#x4E2D;&#xFF0C;&#x5F97;&#x5230;&#x7ED3;&#x679C;&#x3002;&#x5728;&#x672C;&#x4F8B;&#x4E2D;&#x4F7F;&#x7528;&#x7684;&#x6570;&#x636E;&#x96C6;&#x662F;&#x4ECE; Yelp &#x7684;&#x7B7E;&#x5230;&#x6570;&#x636E;&#xFF0C;&#x5B83;&#x5177;&#x6709;&#x4EE5;&#x4E0B;&#x7ED3;&#x6784;&#xFF1A;</p>
<pre><code class="lang-bash">check-in
{
    <span class="hljs-string">&apos;type&apos;</span>: <span class="hljs-string">&apos;checkin&apos;</span>,
    <span class="hljs-string">&apos;business_id&apos;</span>: (encrypted business id),
    <span class="hljs-string">&apos;checkin_info&apos;</span>: {
        <span class="hljs-string">&apos;0-0&apos;</span>: (number of checkins from <span class="hljs-number">00</span>:<span class="hljs-number">00</span> to <span class="hljs-number">01</span>:<span class="hljs-number">00</span> on all Sundays),
        <span class="hljs-string">&apos;1-0&apos;</span>: (number of checkins from <span class="hljs-number">01</span>:<span class="hljs-number">00</span> to <span class="hljs-number">02</span>:<span class="hljs-number">00</span> on all Sundays),
        ...
        <span class="hljs-string">&apos;14-4&apos;</span>: (number of checkins from <span class="hljs-number">14</span>:<span class="hljs-number">00</span> to <span class="hljs-number">15</span>:<span class="hljs-number">00</span> on all Thursdays),
        ...
        <span class="hljs-string">&apos;23-6&apos;</span>: (number of checkins from <span class="hljs-number">23</span>:<span class="hljs-number">00</span> to <span class="hljs-number">00</span>:<span class="hljs-number">00</span> on all Saturdays)
    }, <span class="hljs-comment"># if there was no checkin for a hour-day block it will not be in the dataset</span>
}
</code></pre>
<p>&#x503C;&#x5F97;&#x5728;&#x8FD9;&#x6BB5;&#x5E95;&#x90E8;&#x91CD;&#x590D;&#x8BC4;&#x8BBA;&#xFF1A;</p>
<pre><code># if there was no checkin for a hour-day block it will not be in the dataset.
</code></pre><p>&#x5143;&#x7D20;&#x7684;&#x540D;&#x79F0;&#xFF0C;&#x5728; checkin_info &#x770B;&#x5230;&#x9884;&#x671F;&#x7684;&#x7ED3;&#x679C;&#x4E4B;&#x524D;&#x53EF;&#x4EE5;&#x6BCF;&#x884C;&#x7684;&#x53D8;&#x5316;&#x3002;&#x6570;&#x636E;&#xFF0C;&#x867D;&#x7136;&#x7B80;&#x5355;&#xFF0C;&#x4F46;&#x662F;&#x662F;&#x9AD8;&#x52A8;&#x6001;&#x7684;&#x6570;&#x636E;&#x3002;&#x5728;&#x4F60;&#x4F1A;&#x5728; Hadoop &#x4E0A;&#x4F7F;&#x7528;&#x4EFB;&#x4F55; SQL &#x6280;&#x672F;&#xFF0C;&#x5BF9;&#x6570;&#x636E;&#x8FDB;&#x884C;&#x5206;&#x6790;&#x65F6;&#xFF0C;&#x65E0;&#x9700;&#x9996;&#x5148;&#x5728;&#x6570;&#x636E;&#x96C6;&#x4E0A;&#x5EFA;&#x7ACB;&#x4E00;&#x4E2A;&#x6241;&#x5E73;&#x7684;&#x5173;&#x7CFB;&#x7ED3;&#x6784;&#x3002;</p>
<p>&#x7B2C;&#x4E00;&#x6B65;&#xFF1A;&#x9996;&#x5148;&#x4E0B;&#x8F7D; Drill&#xFF0C;&#x5982;&#x679C;&#x4F60;&#x8FD8;&#x6CA1;&#x6709;&#x4E0B;&#x8F7D;&#xFF0C;&#x90A3;&#x4E48;&#x8BF7;&#x5148;&#x5728;&#x4F60;&#x7684;&#x673A;&#x5668;&#x4E0A;&#x4E0B;&#x8F7D;&#x3002;</p>
<pre><code>http://drill.apache.org/download/
tar -xvf apache-drill-1.4.0.tar
</code></pre><p>&#x5B89;&#x88C5; Drill &#x5728;&#x4F60;&#x7684;&#x672C;&#x673A;&#x4E0A;&#xFF08;&#x6216;&#x8005;&#x662F;&#x672C;&#x673A;&#x7684;&#x865A;&#x62DF;&#x673A;&#x4E0A;&#xFF09;&#x3002;&#x4F60;&#x4E0D;&#x9700;&#x8981; Hadoop&#x3002;</p>
<p>&#x7B2C;&#x4E8C;&#x6B65;&#xFF1A;&#x542F;&#x52A8; Drill Shell&#x3002;</p>
<pre><code class="lang-bash">bin/drill-embedded
</code></pre>
<p>&#x7B2C;&#x4E09;&#x6B65;&#xFF1A;&#x4F7F;&#x7528; SQL &#x53BB;&#x5206;&#x6790;&#x6570;&#x636E;</p>
<p>&#x9996;&#x5148;&#xFF0C;&#x8BA9;&#x6211;&#x4EEC;&#x5148;&#x770B;&#x770B;&#x6570;&#x636E;&#x96C6;&#xFF1A;</p>
<pre><code class="lang-bash"><span class="hljs-number">0</span>: jdbc:drill:zk=<span class="hljs-built_in">local</span>&gt; SELECT * FROM dfs.`/users/nrentachintala/Downloads/yelp/yelp_academic_dataset_checkin.json` <span class="hljs-built_in">limit</span> <span class="hljs-number">2</span>;
+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+------------+------------------------+
|                                                                 checkin_info                                                                                                                                                             |    <span class="hljs-built_in">type</span>    |      business_id       |
+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+------------+------------------------+
| {<span class="hljs-string">&quot;3-4&quot;</span>:<span class="hljs-number">1</span>,<span class="hljs-string">&quot;13-5&quot;</span>:<span class="hljs-number">1</span>,<span class="hljs-string">&quot;6-6&quot;</span>:<span class="hljs-number">1</span>,<span class="hljs-string">&quot;14-5&quot;</span>:<span class="hljs-number">1</span>,<span class="hljs-string">&quot;14-6&quot;</span>:<span class="hljs-number">1</span>,<span class="hljs-string">&quot;14-2&quot;</span>:<span class="hljs-number">1</span>,<span class="hljs-string">&quot;14-3&quot;</span>:<span class="hljs-number">1</span>,<span class="hljs-string">&quot;19-0&quot;</span>:<span class="hljs-number">1</span>,<span class="hljs-string">&quot;11-5&quot;</span>:<span class="hljs-number">1</span>,<span class="hljs-string">&quot;13-2&quot;</span>:<span class="hljs-number">1</span>,<span class="hljs-string">&quot;11-6&quot;</span>:<span class="hljs-number">2</span>,<span class="hljs-string">&quot;11-3&quot;</span>:<span class="hljs-number">1</span>,<span class="hljs-string">&quot;12-6&quot;</span>:<span class="hljs-number">1</span>,<span class="hljs-string">&quot;6-5&quot;</span>:<span class="hljs-number">1</span>,<span class="hljs-string">&quot;5-5&quot;</span>:<span class="hljs-number">1</span>,<span class="hljs-string">&quot;9-2&quot;</span>:<span class="hljs-number">1</span>,<span class="hljs-string">&quot;9-5&quot;</span>:<span class="hljs-number">1</span>,<span class="hljs-string">&quot;9-6&quot;</span>:<span class="hljs-number">1</span>,<span class="hljs-string">&quot;5-2&quot;</span>:<span class="hljs-number">1</span>,<span class="hljs-string">&quot;7-6&quot;</span>:<span class="hljs-number">1</span>,<span class="hljs-string">&quot;7-5&quot;</span>:<span class="hljs-number">1</span>,<span class="hljs-string">&quot;7-4&quot;</span>:<span class="hljs-number">1</span>,<span class="hljs-string">&quot;17-5&quot;</span>:<span class="hljs-number">1</span>,<span class="hljs-string">&quot;8-5&quot;</span>:<span class="hljs-number">1</span>,<span class="hljs-string">&quot;10-2&quot;</span>:<span class="hljs-number">1</span>,<span class="hljs-string">&quot;10-5&quot;</span>:<span class="hljs-number">1</span>,<span class="hljs-string">&quot;10-6&quot;</span>:<span class="hljs-number">1</span>} | checkin    | JwUE5GmEO<span class="hljs-operator">-s</span>H1FuwJgKBlQ |
| {<span class="hljs-string">&quot;6-6&quot;</span>:<span class="hljs-number">2</span>,<span class="hljs-string">&quot;6-5&quot;</span>:<span class="hljs-number">1</span>,<span class="hljs-string">&quot;7-6&quot;</span>:<span class="hljs-number">1</span>,<span class="hljs-string">&quot;7-5&quot;</span>:<span class="hljs-number">1</span>,<span class="hljs-string">&quot;8-5&quot;</span>:<span class="hljs-number">2</span>,<span class="hljs-string">&quot;10-5&quot;</span>:<span class="hljs-number">1</span>,<span class="hljs-string">&quot;9-3&quot;</span>:<span class="hljs-number">1</span>,<span class="hljs-string">&quot;12-5&quot;</span>:<span class="hljs-number">1</span>,<span class="hljs-string">&quot;15-3&quot;</span>:<span class="hljs-number">1</span>,<span class="hljs-string">&quot;15-5&quot;</span>:<span class="hljs-number">1</span>,<span class="hljs-string">&quot;15-6&quot;</span>:<span class="hljs-number">1</span>,<span class="hljs-string">&quot;16-3&quot;</span>:<span class="hljs-number">1</span>,<span class="hljs-string">&quot;10-0&quot;</span>:<span class="hljs-number">1</span>,<span class="hljs-string">&quot;15-4&quot;</span>:<span class="hljs-number">1</span>,<span class="hljs-string">&quot;10-4&quot;</span>:<span class="hljs-number">1</span>,<span class="hljs-string">&quot;8-2&quot;</span>:<span class="hljs-number">1</span>}                                                                                               | checkin    | uGykseHzyS5xAMWoN6YUqA |
+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+------------+------------------------+
</code></pre>
<p>&#x6CE8;&#x610F;&#xFF1A;&#x8BE5;&#x6587;&#x6863;&#x8F93;&#x51FA;&#x53EA;&#x662F;&#x4E00;&#x4E2A;&#x793A;&#x4F8B;&#xFF0C;Drill &#x7684;&#x8F93;&#x51FA;&#x7ED3;&#x679C;&#x5E76;&#x4E0D;&#x662F;&#x5BF9;&#x9F50;&#x7684;&#x3002;</p>
<p>&#x4F60;&#x53EF;&#x4EE5;&#x76F4;&#x63A5;&#x67E5;&#x8BE2; JSON &#x6587;&#x4EF6;&#x3002;Schema &#x7684;&#x5B9A;&#x4E49;&#x5728; Hive &#x4E2D;&#x5E76;&#x4E0D;&#x662F;&#x5FC5;&#x9700;&#x7684;&#x3002;checkin_info &#x5217;&#x5728;&#x7B2C;&#x4E00;&#x884C;&#x548C;&#x7B2C;&#x4E8C;&#x884C;&#x662F;&#x4E0D;&#x540C;&#x7684;&#x3002;</p>
<p>Drill &#x63D0;&#x4F9B;&#x4E86;&#x4E00;&#x4E2A;&#x51FD;&#x6570;&#x53EB; KVGEN&#xFF08;Key &#x548C; Value &#x7684;&#x751F;&#x6210;&#x5668;&#xFF09;&#xFF0C;&#x5B83;&#x7528;&#x4E8E;&#x5DE5;&#x4F5C;&#x5728;&#x590D;&#x6742;&#x6570;&#x636E;&#xFF0C;&#x5728;&#x5305;&#x542B;&#x52A8;&#x6001;&#x7684; maps &#x96C6;&#x5408;&#x548C;&#x672A;&#x77E5;&#x7684;&#x5143;&#x7D20;&#x540D;&#x79F0;&#xFF0C;&#x6BD4;&#x5982; checkin_info&#x3002;KVGEN &#x5C06;&#x52A8;&#x6001;&#x7684; Map &#x8F6C;&#x5316;&#x4E3A;&#x952E;&#x503C;&#x5BF9;&#xFF0C;&#x952E;&#x4EE3;&#x8868;&#x52A8;&#x6001;&#x5143;&#x7D20;&#x540D;&#x79F0;&#x7684;&#x6570;&#x7EC4;&#x3002;</p>
<p>&#x8BA9;&#x6211;&#x4EEC;&#x5E94;&#x7528; KVGEN &#x5230; <code>checkin_info</code> &#x5143;&#x7D20;&#x4E2D;&#x53BB;&#x751F;&#x6210;&#x952E;&#x503C;&#x5BF9;&#x3002;</p>
<pre><code class="lang-bash"><span class="hljs-number">0</span>: jdbc:drill:zk=<span class="hljs-built_in">local</span>&gt; SELECT KVGEN(checkin_info) checkins FROM dfs.`/users/nrentachintala/Downloads/yelp/yelp_academic_dataset_checkin.json` LIMIT <span class="hljs-number">2</span>;
+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|                                                                    checkins                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              |
+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| [{<span class="hljs-string">&quot;key&quot;</span>:<span class="hljs-string">&quot;3-4&quot;</span>,<span class="hljs-string">&quot;value&quot;</span>:<span class="hljs-number">1</span>},{<span class="hljs-string">&quot;key&quot;</span>:<span class="hljs-string">&quot;13-5&quot;</span>,<span class="hljs-string">&quot;value&quot;</span>:<span class="hljs-number">1</span>},{<span class="hljs-string">&quot;key&quot;</span>:<span class="hljs-string">&quot;6-6&quot;</span>,<span class="hljs-string">&quot;value&quot;</span>:<span class="hljs-number">1</span>},{<span class="hljs-string">&quot;key&quot;</span>:<span class="hljs-string">&quot;14-5&quot;</span>,<span class="hljs-string">&quot;value&quot;</span>:<span class="hljs-number">1</span>},{<span class="hljs-string">&quot;key&quot;</span>:<span class="hljs-string">&quot;14-6&quot;</span>,<span class="hljs-string">&quot;value&quot;</span>:<span class="hljs-number">1</span>},{<span class="hljs-string">&quot;key&quot;</span>:<span class="hljs-string">&quot;14-2&quot;</span>,<span class="hljs-string">&quot;value&quot;</span>:<span class="hljs-number">1</span>},{<span class="hljs-string">&quot;key&quot;</span>:<span class="hljs-string">&quot;14-3&quot;</span>,<span class="hljs-string">&quot;value&quot;</span>:<span class="hljs-number">1</span>},{<span class="hljs-string">&quot;key&quot;</span>:<span class="hljs-string">&quot;19-0&quot;</span>,<span class="hljs-string">&quot;value&quot;</span>:<span class="hljs-number">1</span>},{<span class="hljs-string">&quot;key&quot;</span>:<span class="hljs-string">&quot;11-5&quot;</span>,<span class="hljs-string">&quot;value&quot;</span>:<span class="hljs-number">1</span>},{<span class="hljs-string">&quot;key&quot;</span>:<span class="hljs-string">&quot;13-2&quot;</span>,<span class="hljs-string">&quot;value&quot;</span>:<span class="hljs-number">1</span>},{<span class="hljs-string">&quot;key&quot;</span>:<span class="hljs-string">&quot;11-6&quot;</span>,<span class="hljs-string">&quot;value&quot;</span>:<span class="hljs-number">2</span>},{<span class="hljs-string">&quot;key&quot;</span>:<span class="hljs-string">&quot;11-3&quot;</span>,<span class="hljs-string">&quot;value&quot;</span>:<span class="hljs-number">1</span>},{<span class="hljs-string">&quot;key&quot;</span>:<span class="hljs-string">&quot;12-6&quot;</span>,<span class="hljs-string">&quot;value&quot;</span>:<span class="hljs-number">1</span>},{<span class="hljs-string">&quot;key&quot;</span>:<span class="hljs-string">&quot;6-5&quot;</span>,<span class="hljs-string">&quot;value&quot;</span>:<span class="hljs-number">1</span>},{<span class="hljs-string">&quot;key&quot;</span>:<span class="hljs-string">&quot;5-5&quot;</span>,<span class="hljs-string">&quot;value&quot;</span>:<span class="hljs-number">1</span>},{<span class="hljs-string">&quot;key&quot;</span>:<span class="hljs-string">&quot;9-2&quot;</span>,<span class="hljs-string">&quot;value&quot;</span>:<span class="hljs-number">1</span>},{<span class="hljs-string">&quot;key&quot;</span>:<span class="hljs-string">&quot;9-5&quot;</span>,<span class="hljs-string">&quot;value&quot;</span>:<span class="hljs-number">1</span>},{<span class="hljs-string">&quot;key&quot;</span>:<span class="hljs-string">&quot;9-6&quot;</span>,<span class="hljs-string">&quot;value&quot;</span>:<span class="hljs-number">1</span>},{<span class="hljs-string">&quot;key&quot;</span>:<span class="hljs-string">&quot;5-2&quot;</span>,<span class="hljs-string">&quot;value&quot;</span>:<span class="hljs-number">1</span>},{<span class="hljs-string">&quot;key&quot;</span>:<span class="hljs-string">&quot;7-6&quot;</span>,<span class="hljs-string">&quot;value&quot;</span>:<span class="hljs-number">1</span>},{<span class="hljs-string">&quot;key&quot;</span>:<span class="hljs-string">&quot;7-5&quot;</span>,<span class="hljs-string">&quot;value&quot;</span>:<span class="hljs-number">1</span>},{<span class="hljs-string">&quot;key&quot;</span>:<span class="hljs-string">&quot;7-4&quot;</span>,<span class="hljs-string">&quot;value&quot;</span>:<span class="hljs-number">1</span>},{<span class="hljs-string">&quot;key&quot;</span>:<span class="hljs-string">&quot;17-5&quot;</span>,<span class="hljs-string">&quot;value&quot;</span>:<span class="hljs-number">1</span>},{<span class="hljs-string">&quot;key&quot;</span>:<span class="hljs-string">&quot;8-5&quot;</span>,<span class="hljs-string">&quot;value&quot;</span>:<span class="hljs-number">1</span>},{<span class="hljs-string">&quot;key&quot;</span>:<span class="hljs-string">&quot;10-2&quot;</span>,<span class="hljs-string">&quot;value&quot;</span>:<span class="hljs-number">1</span>},{<span class="hljs-string">&quot;key&quot;</span>:<span class="hljs-string">&quot;10-5&quot;</span>,<span class="hljs-string">&quot;value&quot;</span>:<span class="hljs-number">1</span>},{<span class="hljs-string">&quot;key&quot;</span>:<span class="hljs-string">&quot;10-6&quot;</span>,<span class="hljs-string">&quot;value&quot;</span>:<span class="hljs-number">1</span>}] |
| [{<span class="hljs-string">&quot;key&quot;</span>:<span class="hljs-string">&quot;6-6&quot;</span>,<span class="hljs-string">&quot;value&quot;</span>:<span class="hljs-number">2</span>},{<span class="hljs-string">&quot;key&quot;</span>:<span class="hljs-string">&quot;6-5&quot;</span>,<span class="hljs-string">&quot;value&quot;</span>:<span class="hljs-number">1</span>},{<span class="hljs-string">&quot;key&quot;</span>:<span class="hljs-string">&quot;7-6&quot;</span>,<span class="hljs-string">&quot;value&quot;</span>:<span class="hljs-number">1</span>},{<span class="hljs-string">&quot;key&quot;</span>:<span class="hljs-string">&quot;7-5&quot;</span>,<span class="hljs-string">&quot;value&quot;</span>:<span class="hljs-number">1</span>},{<span class="hljs-string">&quot;key&quot;</span>:<span class="hljs-string">&quot;8-5&quot;</span>,<span class="hljs-string">&quot;value&quot;</span>:<span class="hljs-number">2</span>},{<span class="hljs-string">&quot;key&quot;</span>:<span class="hljs-string">&quot;10-5&quot;</span>,<span class="hljs-string">&quot;value&quot;</span>:<span class="hljs-number">1</span>},{<span class="hljs-string">&quot;key&quot;</span>:<span class="hljs-string">&quot;9-3&quot;</span>,<span class="hljs-string">&quot;value&quot;</span>:<span class="hljs-number">1</span>},{<span class="hljs-string">&quot;key&quot;</span>:<span class="hljs-string">&quot;12-5&quot;</span>,<span class="hljs-string">&quot;value&quot;</span>:<span class="hljs-number">1</span>},{<span class="hljs-string">&quot;key&quot;</span>:<span class="hljs-string">&quot;15-3&quot;</span>,<span class="hljs-string">&quot;value&quot;</span>:<span class="hljs-number">1</span>},{<span class="hljs-string">&quot;key&quot;</span>:<span class="hljs-string">&quot;15-5&quot;</span>,<span class="hljs-string">&quot;value&quot;</span>:<span class="hljs-number">1</span>},{<span class="hljs-string">&quot;key&quot;</span>:<span class="hljs-string">&quot;15-6&quot;</span>,<span class="hljs-string">&quot;value&quot;</span>:<span class="hljs-number">1</span>},{<span class="hljs-string">&quot;key&quot;</span>:<span class="hljs-string">&quot;16-3&quot;</span>,<span class="hljs-string">&quot;value&quot;</span>:<span class="hljs-number">1</span>},{<span class="hljs-string">&quot;key&quot;</span>:<span class="hljs-string">&quot;10-0&quot;</span>,<span class="hljs-string">&quot;value&quot;</span>:<span class="hljs-number">1</span>},{<span class="hljs-string">&quot;key&quot;</span>:<span class="hljs-string">&quot;15-4&quot;</span>,<span class="hljs-string">&quot;value&quot;</span>:<span class="hljs-number">1</span>},{<span class="hljs-string">&quot;key&quot;</span>:<span class="hljs-string">&quot;10-4&quot;</span>,<span class="hljs-string">&quot;value&quot;</span>:<span class="hljs-number">1</span>},{<span class="hljs-string">&quot;key&quot;</span>:<span class="hljs-string">&quot;8-2&quot;</span>,<span class="hljs-string">&quot;value&quot;</span>:<span class="hljs-number">1</span>}]                                                                                                                                                                                                                                                                               |
+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
</code></pre>
<p>Drill &#x8FD8;&#x63D0;&#x4F9B;&#x4E86;&#x5176;&#x4ED6;&#x7684;&#x51FD;&#x6570;&#x53BB;&#x64CD;&#x4F5C;&#x590D;&#x6742;&#x7684;&#x6570;&#x636E;&#xFF0C;&#x8BE5;&#x51FD;&#x6570;&#x53EB;&#x505A; &#x201C;Flatten&#x201D;&#xFF0C;&#x5B83;&#x7528;&#x4E8E;&#x62C6;&#x5206;&#x952E;&#x503C;&#x5BF9;&#x96C6;&#x5408;&#x4ECE; KVGEN &#x4E2D;&#x8FD4;&#x56DE;&#x7684;&#x7ED3;&#x679C;&#x5F53;&#x4E2D;&#x3002;</p>
<pre><code class="lang-bash"><span class="hljs-number">0</span>: jdbc:drill:zk=<span class="hljs-built_in">local</span>&gt; SELECT FLATTEN(KVGEN(checkin_info)) checkins FROM dfs.`/users/nrentachintala/Downloads/yelp/yelp_academic_dataset_checkin.json` LIMIT <span class="hljs-number">20</span>;
+--------------------------+
|         checkins         |
+--------------------------+
| {<span class="hljs-string">&quot;key&quot;</span>:<span class="hljs-string">&quot;3-4&quot;</span>,<span class="hljs-string">&quot;value&quot;</span>:<span class="hljs-number">1</span>}  |
| {<span class="hljs-string">&quot;key&quot;</span>:<span class="hljs-string">&quot;13-5&quot;</span>,<span class="hljs-string">&quot;value&quot;</span>:<span class="hljs-number">1</span>} |
| {<span class="hljs-string">&quot;key&quot;</span>:<span class="hljs-string">&quot;6-6&quot;</span>,<span class="hljs-string">&quot;value&quot;</span>:<span class="hljs-number">1</span>}  |
| {<span class="hljs-string">&quot;key&quot;</span>:<span class="hljs-string">&quot;14-5&quot;</span>,<span class="hljs-string">&quot;value&quot;</span>:<span class="hljs-number">1</span>} |
| {<span class="hljs-string">&quot;key&quot;</span>:<span class="hljs-string">&quot;14-6&quot;</span>,<span class="hljs-string">&quot;value&quot;</span>:<span class="hljs-number">1</span>} |
| {<span class="hljs-string">&quot;key&quot;</span>:<span class="hljs-string">&quot;14-2&quot;</span>,<span class="hljs-string">&quot;value&quot;</span>:<span class="hljs-number">1</span>} |
| {<span class="hljs-string">&quot;key&quot;</span>:<span class="hljs-string">&quot;14-3&quot;</span>,<span class="hljs-string">&quot;value&quot;</span>:<span class="hljs-number">1</span>} |
| {<span class="hljs-string">&quot;key&quot;</span>:<span class="hljs-string">&quot;19-0&quot;</span>,<span class="hljs-string">&quot;value&quot;</span>:<span class="hljs-number">1</span>} |
| {<span class="hljs-string">&quot;key&quot;</span>:<span class="hljs-string">&quot;11-5&quot;</span>,<span class="hljs-string">&quot;value&quot;</span>:<span class="hljs-number">1</span>} |
| {<span class="hljs-string">&quot;key&quot;</span>:<span class="hljs-string">&quot;13-2&quot;</span>,<span class="hljs-string">&quot;value&quot;</span>:<span class="hljs-number">1</span>} |
| {<span class="hljs-string">&quot;key&quot;</span>:<span class="hljs-string">&quot;11-6&quot;</span>,<span class="hljs-string">&quot;value&quot;</span>:<span class="hljs-number">2</span>} |
| {<span class="hljs-string">&quot;key&quot;</span>:<span class="hljs-string">&quot;11-3&quot;</span>,<span class="hljs-string">&quot;value&quot;</span>:<span class="hljs-number">1</span>} |
| {<span class="hljs-string">&quot;key&quot;</span>:<span class="hljs-string">&quot;12-6&quot;</span>,<span class="hljs-string">&quot;value&quot;</span>:<span class="hljs-number">1</span>} |
| {<span class="hljs-string">&quot;key&quot;</span>:<span class="hljs-string">&quot;6-5&quot;</span>,<span class="hljs-string">&quot;value&quot;</span>:<span class="hljs-number">1</span>}  |
| {<span class="hljs-string">&quot;key&quot;</span>:<span class="hljs-string">&quot;5-5&quot;</span>,<span class="hljs-string">&quot;value&quot;</span>:<span class="hljs-number">1</span>}  |
| {<span class="hljs-string">&quot;key&quot;</span>:<span class="hljs-string">&quot;9-2&quot;</span>,<span class="hljs-string">&quot;value&quot;</span>:<span class="hljs-number">1</span>}  |
| {<span class="hljs-string">&quot;key&quot;</span>:<span class="hljs-string">&quot;9-5&quot;</span>,<span class="hljs-string">&quot;value&quot;</span>:<span class="hljs-number">1</span>}  |
| {<span class="hljs-string">&quot;key&quot;</span>:<span class="hljs-string">&quot;9-6&quot;</span>,<span class="hljs-string">&quot;value&quot;</span>:<span class="hljs-number">1</span>}  |
| {<span class="hljs-string">&quot;key&quot;</span>:<span class="hljs-string">&quot;5-2&quot;</span>,<span class="hljs-string">&quot;value&quot;</span>:<span class="hljs-number">1</span>}  |
| {<span class="hljs-string">&quot;key&quot;</span>:<span class="hljs-string">&quot;7-6&quot;</span>,<span class="hljs-string">&quot;value&quot;</span>:<span class="hljs-number">1</span>}  |
+--------------------------+
</code></pre>
<p>&#x4F60;&#x53EF;&#x4EE5;&#x5FEB;&#x901F;&#x7684;&#x83B7;&#x53D6;&#x6570;&#x636E;&#x901A;&#x8FC7;&#x5E94;&#x7528; KVGEN &#x548C; FLATTEN &#x51FD;&#x6570;&#x4E8E;&#x6570;&#x636E;&#x96C6;&#x4E0A;&#xFF0C;&#x4E0D;&#x9700;&#x8981;&#x82B1;&#x65F6;&#x95F4;&#x53BB;&#x5B9A;&#x4E49; Schema &#x548C;&#x6570;&#x636E;&#x5B58;&#x50A8;&#x7684;&#x4E2D;&#x95F4;&#x683C;&#x5F0F;&#x3002;</p>
<p>&#x5728;&#x8F93;&#x51FA;&#x7684;&#x6241;&#x5E73;&#x6570;&#x636E;&#x4E2D;&#xFF0C;&#x4F60;&#x4F7F;&#x7528;&#x6807;&#x51C6;&#x7684; SQL &#x529F;&#x80FD;&#xFF0C;&#x4F8B;&#x5982; filters&#xFF0C;aggregates &#x548C; sort&#x3002;&#x8BA9;&#x6211;&#x4EEC;&#x5148;&#x770B;&#x4E00;&#x4E9B;&#x4F8B;&#x5B50;&#x3002;</p>
<h2 id="&#x83B7;&#x53D6;-yelp-&#x6570;&#x636E;&#x96C6;&#x4E2D;&#x7684;&#x603B;&#x8BC4;&#x8BBA;&#x4E2D;&#xFF0C;&#x4ECE;-checkinins-&#x8BB0;&#x5F55;&#x4E2D;">&#x83B7;&#x53D6; Yelp &#x6570;&#x636E;&#x96C6;&#x4E2D;&#x7684;&#x603B;&#x8BC4;&#x8BBA;&#x4E2D;&#xFF0C;&#x4ECE; checkin-ins &#x8BB0;&#x5F55;&#x4E2D;</h2>
<pre><code class="lang-bash"><span class="hljs-number">0</span>: jdbc:drill:zk=<span class="hljs-built_in">local</span>&gt; SELECT SUM(checkintbl.checkins.`value`) AS TotalCheckins FROM (
. . . . . . . . . . . &gt;  SELECT FLATTEN(KVGEN(checkin_info)) checkins FROM dfs.`/users/nrentachintala/Downloads/yelp/yelp_academic_dataset_checkin.json` ) checkintbl
. . . . . . . . . . . &gt;  ;
+---------------+
| TotalCheckins |
+---------------+
| <span class="hljs-number">4713811</span>       |
+---------------+
</code></pre>
<h2 id="&#x83B7;&#x53D6;&#x661F;&#x671F;&#x5929;&#x665A;&#x4E0A;&#x7684;&#x6570;&#x636E;">&#x83B7;&#x53D6;&#x661F;&#x671F;&#x5929;&#x665A;&#x4E0A;&#x7684;&#x6570;&#x636E;</h2>
<pre><code class="lang-bash"><span class="hljs-number">0</span>: jdbc:drill:zk=<span class="hljs-built_in">local</span>&gt; SELECT SUM(checkintbl.checkins.`value`) AS SundayMidnightCheckins FROM (
. . . . . . . . . . . &gt;  SELECT FLATTEN(KVGEN(checkin_info)) checkins FROM dfs.`/users/nrentachintala/Downloads/yelp/yelp_academic_dataset_checkin.json` ) checkintbl WHERE checkintbl.checkins.key=<span class="hljs-string">&apos;23-0&apos;</span>;
+------------------------+
| SundayMidnightCheckins |
+------------------------+
| <span class="hljs-number">8575</span>                   |
+------------------------+
</code></pre>
<h2 id="&#x83B7;&#x53D6;&#x4E00;&#x5468;&#x4E2D;&#x6BCF;&#x5929;&#x7684;&#x6570;&#x636E;">&#x83B7;&#x53D6;&#x4E00;&#x5468;&#x4E2D;&#x6BCF;&#x5929;&#x7684;&#x6570;&#x636E;</h2>
<pre><code class="lang-bash"><span class="hljs-number">0</span>: jdbc:drill:zk=<span class="hljs-built_in">local</span>&gt; SELECT `right`(checkintbl.checkins.key,<span class="hljs-number">1</span>) WeekDay,sum(checkintbl.checkins.`value`) TotalCheckins from (
. . . . . . . . . . . &gt;  select flatten(kvgen(checkin_info)) checkins FROM dfs.`/users/nrentachintala/Downloads/yelp/yelp_academic_dataset_checkin.json`  ) checkintbl GROUP BY `right`(checkintbl.checkins.key,<span class="hljs-number">1</span>) ORDER BY TotalCheckins;
+------------+---------------+
|  WeekDay   | TotalCheckins |
+------------+---------------+
| <span class="hljs-number">1</span>          | <span class="hljs-number">545626</span>        |
| <span class="hljs-number">0</span>          | <span class="hljs-number">555038</span>        |
| <span class="hljs-number">2</span>          | <span class="hljs-number">555747</span>        |
| <span class="hljs-number">3</span>          | <span class="hljs-number">596296</span>        |
| <span class="hljs-number">6</span>          | <span class="hljs-number">735830</span>        |
| <span class="hljs-number">4</span>          | <span class="hljs-number">788073</span>        |
| <span class="hljs-number">5</span>          | <span class="hljs-number">937201</span>        |
+------------+---------------+
</code></pre>
<h2 id="&#x83B7;&#x53D6;&#x4E00;&#x5929;&#x4E2D;&#x6BCF;&#x5C0F;&#x65F6;&#x7684;&#x6570;&#x636E;">&#x83B7;&#x53D6;&#x4E00;&#x5929;&#x4E2D;&#x6BCF;&#x5C0F;&#x65F6;&#x7684;&#x6570;&#x636E;</h2>
<pre><code class="lang-bash"><span class="hljs-number">0</span>: jdbc:drill:zk=<span class="hljs-built_in">local</span>&gt; SELECT SUBSTR(checkintbl.checkins.key,<span class="hljs-number">1</span>,strpos(checkintbl.checkins.key,<span class="hljs-string">&apos;-&apos;</span>)-<span class="hljs-number">1</span>) AS HourOfTheDay ,SUM(checkintbl.checkins.`value`) TotalCheckins FROM (
. . . . . . . . . . . &gt;  SELECT FLATTEN(KVGEN(checkin_info)) checkins FROM dfs.`/users/nrentachintala/Downloads/yelp/yelp_academic_dataset_checkin.json` ) checkintbl GROUP BY SUBSTR(checkintbl.checkins.key,<span class="hljs-number">1</span>,strpos(checkintbl.checkins.key,<span class="hljs-string">&apos;-&apos;</span>)-<span class="hljs-number">1</span>) ORDER BY TotalCheckins;
+--------------+---------------+
| HourOfTheDay | TotalCheckins |
+--------------+---------------+
| <span class="hljs-number">3</span>            | <span class="hljs-number">20357</span>         |
| <span class="hljs-number">4</span>            | <span class="hljs-number">21076</span>         |
| <span class="hljs-number">2</span>            | <span class="hljs-number">28116</span>         |
| <span class="hljs-number">5</span>            | <span class="hljs-number">33842</span>         |
| <span class="hljs-number">1</span>            | <span class="hljs-number">45467</span>         |
| <span class="hljs-number">6</span>            | <span class="hljs-number">54174</span>         |
| <span class="hljs-number">0</span>            | <span class="hljs-number">74127</span>         |
| <span class="hljs-number">7</span>            | <span class="hljs-number">96329</span>         |
| <span class="hljs-number">23</span>           | <span class="hljs-number">102009</span>        |
| <span class="hljs-number">8</span>            | <span class="hljs-number">130091</span>        |
| <span class="hljs-number">22</span>           | <span class="hljs-number">140338</span>        |
| <span class="hljs-number">9</span>            | <span class="hljs-number">162913</span>        |
| <span class="hljs-number">21</span>           | <span class="hljs-number">211949</span>        |
| <span class="hljs-number">10</span>           | <span class="hljs-number">220687</span>        |
| <span class="hljs-number">15</span>           | <span class="hljs-number">261384</span>        |
| <span class="hljs-number">14</span>           | <span class="hljs-number">276188</span>        |
| <span class="hljs-number">16</span>           | <span class="hljs-number">292547</span>        |
| <span class="hljs-number">20</span>           | <span class="hljs-number">293783</span>        |
| <span class="hljs-number">13</span>           | <span class="hljs-number">328373</span>        |
| <span class="hljs-number">11</span>           | <span class="hljs-number">338675</span>        |
| <span class="hljs-number">17</span>           | <span class="hljs-number">374186</span>        |
| <span class="hljs-number">19</span>           | <span class="hljs-number">385381</span>        |
| <span class="hljs-number">12</span>           | <span class="hljs-number">399797</span>        |
| <span class="hljs-number">18</span>           | <span class="hljs-number">422022</span>        |
+--------------+---------------+
</code></pre>
<h2 id="&#x603B;&#x7ED3;">&#x603B;&#x7ED3;</h2>
<p>&#x672C;&#x6559;&#x7A0B;&#x4E2D;&#xFF0C;&#x4F60;&#x6D4F;&#x89C8;&#x7ED3;&#x6784;&#x5316;&#x548C;&#x534A;&#x7ED3;&#x6784;&#x5316;&#x7684;&#x6570;&#x636E;&#x65F6;&#xFF0C;&#x6CA1;&#x6709;&#x4EFB;&#x4F55;&#x7684; Schema &#x7BA1;&#x7406;&#x548C; ETL&#x3002;</p>
<footer class="page-footer"><span class="copyright">Copyright &#xA9; http://drill.smartloli.org 2016 all right reserved&#xFF0C;powered by Gitbook</span><span class="footer-modification">Modify: 
2016-01-11 15:15:02
</span></footer>
                    
                    </section>
                
                
                </div>
            </div>
        </div>

        
        <a href="../3.教程/4.在 MapR 的 Sandbox 中学习 Drill/7.总结.html" class="navigation navigation-prev " aria-label="Previous page: 7.总结"><i class="fa fa-angle-left"></i></a>
        
        
        <a href="../3.教程/6.社会媒体分析.html" class="navigation navigation-next " aria-label="Next page: 6.社会媒体分析"><i class="fa fa-angle-right"></i></a>
        
    </div>
</div>

        
<script src="../gitbook/app.js"></script>

    
    <script src="../gitbook/plugins/gitbook-plugin-baidu/plugin.js"></script>
    

    
    <script src="../gitbook/plugins/gitbook-plugin-sharing/buttons.js"></script>
    

    
    <script src="../gitbook/plugins/gitbook-plugin-fontsettings/buttons.js"></script>
    

    
    <script src="../gitbook/plugins/gitbook-plugin-livereload/plugin.js"></script>
    

<script>
require(["gitbook"], function(gitbook) {
    var config = {"tbfed-pagefooter":{"copyright":"Copyright &copy http://drill.smartloli.org 2016","modify_label":"Modify: ","modify_format":"YYYY-MM-DD HH:mm:ss"},"baidu":{"token":""},"fontsettings":{"size":1,"theme":"white","family":"sans"},"highlight":{},"sharing":{"facebook":true,"twitter":true,"google":false,"weibo":false,"instapaper":false,"vk":false,"all":["facebook","google","twitter","weibo","instapaper"]},"livereload":{}};
    gitbook.start(config);
});
</script>

        <script>var _hmt = _hmt || [];(function() {var hm = document.createElement('script');hm.src = '//hm.baidu.com/hm.js?';var s = document.getElementsByTagName('script')[0];s.parentNode.insertBefore(hm, s);})();</script>
    </body>
    
</html>
